/* 应用商城原型 - 全局样式 */

/* 全局变量 */
:root {
  --primary-color: #007aff;
  --secondary-color: #5856d6;
  --success-color: #34c759;
  --warning-color: #ff9500;
  --danger-color: #ff3b30;
  --gray-color: #8e8e93;
  --light-gray: #d1d1d6;
  --extra-light-gray: #f2f2f7;
  --bg-color: #f8f8f8;
  --text-color: #000;
  --text-secondary: #6c6c6c;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "San Francisco", Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-color);
  background-color: var(--bg-color);
  font-size: 14px;
  line-height: 1.5;
}

/* iPhone 容器样式 */
.iphone-container {
  position: relative;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: white;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px 5px;
  background-color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.status-bar-icons {
  display: flex;
  align-items: center;
}

/* 导航栏 */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--extra-light-gray);
  border-radius: 10px;
  padding: 8px 12px;
  transition: all 0.3s ease;
}

.search-box.active {
  background-color: #e9e9eb;
}

.search-box i {
  color: var(--gray-color);
  margin-right: 8px;
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 14px;
  color: var(--text-color);
  cursor: pointer;
}

/* 内容区域 */
.content {
  padding-bottom: 70px;
  overflow-y: auto;
  min-height: calc(100vh - 120px);
}

/* 轮播图相关样式 */
.swiper {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.swiper-wrapper {
  display: flex;
  transition: transform 0.3s ease-out;
  height: 100%;
}

.swiper-slide {
  flex: 0 0 100%;
  height: 100%;
}

.swiper-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.swiper-pagination {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.swiper-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.swiper-dot.active {
  background-color: white;
  width: 16px;
  border-radius: 3px;
}

/* 金刚区 */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 16px;
  gap: 12px;
  margin-bottom: 16px;
}

.quick-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.quick-nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  font-size: 20px;
  transition: transform 0.2s ease;
}

.quick-nav-item:active .quick-nav-icon {
  transform: scale(0.95);
}

.quick-nav-text {
  font-size: 12px;
  color: var(--text-color);
}

/* 区块标题 */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 12px;
  font-weight: 600;
}

.section-more {
  color: var(--primary-color);
  font-size: 12px;
  font-weight: normal;
}

/* 应用卡片 */
.app-card {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid var(--extra-light-gray);
  cursor: pointer;
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  margin-right: 12px;
  object-fit: cover;
}

.app-info {
  flex: 1;
}

.app-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.app-category {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 6px;
}

.app-rating {
  font-size: 12px;
  color: var(--text-secondary);
}

.app-rating i {
  color: #ffcc00;
}

.app-rating-value {
  margin-right: 5px;
}

.app-download {
  margin-left: 5px;
}

.app-download-btn {
  background-color: var(--extra-light-gray);
  color: var(--primary-color);
  font-weight: 600;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-download-btn:hover {
  background-color: #e3e3e8;
}

.app-download-btn.downloading {
  background-color: var(--light-gray);
  color: var(--text-secondary);
}

.app-download-btn.installed {
  background-color: var(--extra-light-gray);
  color: var(--success-color);
}

/* 文章卡片 */
.article-card {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid var(--extra-light-gray);
  cursor: pointer;
}

.article-cover {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  margin-right: 12px;
  object-fit: cover;
}

.article-info {
  flex: 1;
}

.article-title {
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-desc {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--gray-color);
}

/* 底部导航栏 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  background-color: #fff;
  border-top: 1px solid var(--extra-light-gray);
  z-index: 10;
  max-width: 390px;
  margin: 0 auto;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 25%;
  height: 100%;
  color: var(--gray-color);
  cursor: pointer;
}

.tab-item i {
  font-size: 22px;
  margin-bottom: 4px;
}

.tab-item span {
  font-size: 10px;
}

.tab-item.active {
  color: var(--primary-color);
}

/* 应用详情页样式 */
.app-detail-header {
  display: flex;
  align-items: center;
  padding: 16px;
}

.app-detail-icon {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  margin-right: 16px;
}

.app-detail-info {
  flex: 1;
}

.app-detail-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.app-detail-developer {
  color: var(--primary-color);
  font-size: 14px;
  margin-bottom: 8px;
}

.app-detail-download-btn {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
  margin-top: 10px;
}

.app-detail-download-btn:hover {
  background-color: #0062cc;
}

.app-detail-section {
  padding: 16px;
  border-bottom: 8px solid var(--extra-light-gray);
}

.app-detail-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.app-screenshots {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.app-screenshot {
  min-width: 200px;
  height: 350px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--light-gray);
}

.app-description {
  line-height: 1.6;
  color: var(--text-secondary);
}

.app-features {
  margin: 16px 0;
}

.app-feature-item {
  display: flex;
  margin-bottom: 12px;
}

.app-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--extra-light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.app-feature-info {
  flex: 1;
}

.app-feature-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.app-feature-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.app-reviews {
  margin-top: 16px;
}

.review-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--extra-light-gray);
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review-name {
  font-weight: 600;
}

.review-date {
  font-size: 12px;
  color: var(--gray-color);
}

.review-rating {
  margin-bottom: 6px;
}

.review-rating i {
  color: #ffcc00;
  font-size: 12px;
}

.review-content {
  font-size: 14px;
  line-height: 1.5;
}

/* 轮播图切换动画 */
@keyframes slide-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* 提示消息 */
.toast-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
  text-align: center;
  max-width: 80%;
}

.toast-message.show {
  opacity: 1;
  visibility: visible;
}

/* 分享面板 */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 900;
}

.share-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-width: 390px;
  margin: 0 auto;
}

.share-panel.show {
  transform: translateY(0);
}

.share-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--extra-light-gray);
}

.share-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-color);
  cursor: pointer;
}

.share-panel-options {
  display: flex;
  padding: 20px 16px;
  justify-content: space-around;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.share-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 24px;
  color: white;
}

.share-icon.wechat {
  background-color: #07c160;
}

.share-icon.weibo {
  background-color: #e6162d;
}

.share-icon.qq {
  background-color: #12b7f5;
}

.share-icon.link {
  background-color: #f5a623;
}

.share-panel-content {
  padding: 16px;
  border-top: 1px solid var(--extra-light-gray);
  background-color: var(--extra-light-gray);
}

.share-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.share-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 下载动画 */
.app-download-btn {
  position: relative;
  overflow: hidden;
}

.app-download-btn.downloading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: downloading 1.5s infinite;
}

@keyframes downloading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* 点击动画 */
.app-card:active,
.article-card:active,
.quick-nav-item:active {
  background-color: var(--extra-light-gray);
}

.share-option:active .share-icon {
  transform: scale(0.95);
}
